package subject_set.lanqiao;

import java.util.Scanner;

/**
 * @author haomin
 * @date 2022/10/24 15:46
 **/
public class Num1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int[] arr = new int[26];
        for(int i = 0; i < str.length(); ++i){
            arr[str.charAt(i) - 'a']++;
        }
        int max = 0, value = 0;
        for(int i = 0; i < arr.length; ++i){
            if(max < arr[i]){
                max = arr[i];
                value = i;
            }
        }
        System.out.println((char)(value+'a'));
        System.out.println(max);
        scan.close();
    }
}